<section class="box">

	<header>
		<h3><?php echo lang('pyrodb.browsing'). ' ' .$table_name; ?></h3>
		 <p><?php echo $query; ?></p>
	</header>
	
	<table class="table-list">
    <?php if( $results ): ?>
		<thead>
			<tr>
			    <th>Delete</th>
    		    <th>Edit</th>
    		    <th>|</th>
			<?php $keys = array(); foreach( $results[0] as $key => $result ): ?>
				<th><?php echo $keys[] = $key; ?></th>
			<?php endforeach; ?>
			</tr>
		</thead>
		<tbody>
			<?php foreach( $results as $result ): ?>
			<tr>
			    <td class="delete"><?php echo anchor('admin/database/browse/'.$table_name, "<br/>"); ?></td>
			    <td class="edit"><?php echo anchor('admin/database/browse/'.$table_name, "<br/>"); ?></td>
			    <td> </td>
			<?php foreach( $keys  as $key ): ?>
				<td><?php echo $result[$key]; ?></td>
			<?php endforeach; ?>
			</tr>			
			<?php endforeach; ?>
		</tbody>
	<?php else: ?>
		<p><?php echo lang('pyrodb.no_entries_in_table'); ?></p>
	<?php endif; ?>
	</table>

</section>


<?php //endif; ?>
